

const {getShops,getShopsByPage,updateShops,addShops} = require("../dao/shopsDao");

// 获取门店
module.exports.getShops = async function (shops){
     if(shops.pageSize){
        // console.log("本页",shops.pageSize)
        return await getShopsByPage(shops)
    }
    else{
        return await getShops(shops)
    }
};
//修改门店
module.exports.updateShops = async function (shops){
    const data =  await updateShops(shops)
    // console.log(data)
    if(data.ok==1){
        return true
    }else{
        return false
    }
};

// 新增门店
module.exports.addShops = async function (shop){
    const data =  await addShops(shop)
    console.log("新增",data)
    return data
};